﻿@{
	ViewBag.Title = @Resources.CheckPaymentRecord;
}
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
	<tr>
		<td class="b1">
			<div>
				<p><img src="~/images/icon_06.png" align="absmiddle" />&nbsp;@Resources.Menu_UserCenter<span>&nbsp;>>&nbsp;</span>@Resources.CheckPaymentRecord
			</div>
		</td>
	</tr>
	<tr>
		<td class="b4">
			<div class="c">
				<div class="right" id="mainFrame">
					<div class="right_cont">
						<div id="dataGrid"></div>
						<div id="toolBar">
							<div id="searchBar">
								<div style="float: left; display: inline; padding: 5px 5px; font-weight: bold; text-align: left;">
									@Resources.ConferenceName：<input id="queryConferenceName" name="queryConferenceName" class="easyui-textbox" style="height:27px; width:200px;">&nbsp;&nbsp;
									@Resources.PaidStatus：<select id="queryHasPaid" name="queryHasPaid" class="easyui-combobox" style="height:27px; width:200px;" data-options="editable:false,panelHeight:'auto'">
										<option value="@ConstValues.strSpace">@Resources.All</option>
										<option value="@ConstValues.PaidStatus.已缴费">@Resources.SuccessPay</option>
										<option value="@ConstValues.PaidStatus.未缴费">@Resources.FailPay</option>
									</select>&nbsp;&nbsp;
									<a class="easyui-linkbutton" iconcls="icon-search" onclick="searchData()">@Resources.Search </a>
								</div>
							</div>
							<div id="menuBar"></div>
							<div class="clear"></div>
						</div>
					</div>
				</div>
			</div>
		</td>
	</tr>
</table>

@section Scripts {
<script>
	var windowHeight = $(window).height() - 200;
	$("#mainFrame").css("height", (windowHeight)+"px");

	$(function () {
		$("#queryConferenceName").textbox("textbox").bind("keydown", function (e) {
			if (e.keyCode == 13) {
				searchData()
			}
		});

		$("#dataGrid").datagrid({
			url: "@Url.Action(nameof(ProfilePaymentController.GetData),
					nameof(ProfilePaymentController).GetControllerName())",
			method: "get",
			fitColumns: true,
			singleSelect: true,
			width: 1200,
			height: $(window).height() - 110,
			nowrap: false,
			pagination: true,
			pageSize: @ConstValues.DefaultGridRows,
			striped: true,
			toolbar: "#toolBar",
			pageSize: 100, 
			pageList: [100, 200, 300, 400, 500],
			columns: [[
				{
					field: "conferenceName", title: "@Resources.ConferenceName", align: "center", sortable: true,  width: 180,
			    		formatter: function (value, rec) {
			    			var conStr = ""
			    			if (rec.homePageUrl != null && rec.homePageUrl != "") {
			    				conStr += "<a href=' "+ rec.homePageUrl +" ' style='color:#1874CD;text-decoration:underline;' target='_blank'>" + value + "</a>  "
			    			} else {
			    				var tmp = rec.conferenceNickName == null ? "" : rec.conferenceNickName.replace(new RegExp("'",'g'),"’").replace(new RegExp('"','g'),"“");
			    				conStr += "<a href='@Url.Action(nameof(MeetingMainController.Index), nameof(MeetingMainController).GetControllerName())"
									+ "/" + tmp + "' style='color:#1874CD;text-decoration:underline;' target='_blank'>" + value + "</a>  ";
			    			}
			    			return conStr;
			    		}
				},
				{ field: "currency", title: "@Resources.Currency", align: "center", sortable: true,  width: 100 },
				{ field: "fee", title: "@Resources.Fee", align: "center", sortable: true, width: 150 },
				{
					field: "feeStatus", title: "@Resources.PayStatus", align: "center", sortable: true, width: 150,
					formatter: function (value, rec) {
			    			if (value == true) {
			    				return "@Resources.SuccessPay"
			    			} else {
			    				return "@Resources.FailPay"
			    			}
					}
				},
				{ field: "createDate", title: "@Resources.PayDate", align: "center", width: 150, sortable: true },
			]]
		});
	});

	function searchData() {
		$("#dataGrid").datagrid("load", {
			queryConferenceName: $("#queryConferenceName").textbox("getValue"),
			queryHasPaid: $("#queryHasPaid").combobox("getValue"),
		});
	}
</script>
}